package cn.edu.xmu.restfuldemo.model.BO;

import cn.edu.xmu.restfuldemo.model.PO.GoodsPo;
import cn.edu.xmu.restfuldemo.model.PO.ProductPo;
import lombok.*;

import java.time.LocalDateTime;

/**
 * @author Team3-5
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Product {
    private Long id;
    private Long goodsId;
    private String productSn;
    private String name;
    private Long originalPrice;
    private Long weight;
    private String imageUrl;
    private Byte state;
    private String detail;
    private Byte disabled;
    private LocalDateTime gmtCreate;
    private LocalDateTime gmtModified;

    /**
     * Product->ProductPo
     * @return
     */
    public ProductPo newProductPo(){
        ProductPo productPo = new ProductPo();
        productPo.setId(this.id);
        productPo.setGoodsId(this.goodsId);
        productPo.setProductSn(this.productSn);
        productPo.setName(this.name);
        productPo.setOriginalPrice(this.originalPrice);
        productPo.setWeight(this.weight);
        productPo.setState(this.state);
        productPo.setDetail(this.detail);
        productPo.setImageUrl(this.imageUrl);
        productPo.setDisabled(this.disabled);
        productPo.setGmtCreate(this.gmtCreate);
        productPo.setGmtModified(this.gmtModified);
        return productPo;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public String getProductSn() {
        return productSn;
    }

    public void setProductSn(String productSn) {
        this.productSn = productSn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(Long originalPrice) {
        this.originalPrice = originalPrice;
    }

    public Long getWeight() {
        return weight;
    }

    public void setWeight(Long weight) {
        this.weight = weight;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public Byte getDisabled() {
        return disabled;
    }

    public void setDisabled(Byte disabled) {
        this.disabled = disabled;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(LocalDateTime gmtModified) {
        this.gmtModified = gmtModified;
    }
}
